<script setup lang="ts">
import {ref} from 'vue';
import {Modal} from 'ant-design-vue';
import {HomeOutlined} from '@ant-design/icons-vue';
import Barcode from '@/components/Barcode/index.vue';
import {useI18n} from '@/hooks';
const {t} = useI18n();
const visible = ref(false);
const data = ref([
  {id: 1, value: '1111111111'},
  {id: 2, value: '2222222222'},
]);
const showConfirm = () => {
  Modal.confirm({
    title: 'Do you Want to delete these items?',
    content: 'dddd',
    onOk() {
      console.log('OK');
    },
    onCancel() {
      console.log('Cancel');
    },
    class: 'test',
  });
};
const showModal = () => {
  visible.value = true;
};
</script>

<template>
  <a-button type="primary">Primary Button</a-button>
  <a-button type="primary" @click="showConfirm">{{ t('common.okText') }}</a-button>
  <a-button type="primary" @click="showModal">测试条形码打印</a-button>
  <Barcode v-model:visible="visible" :data="data" />
  <home-outlined />
</template>
